package dynProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler{
	
	private Subject subject;

	public MyInvocationHandler(Subject subject) {
		this.subject = subject;
	}
	
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("start");
		subject.doTask();
		System.out.println("end");
		return null;
	}

}
